#include <stdio.h>
#include "dynamicArrayStack.h"
#include "common.h"
#define BUFFER_SIZE 5
int main()
{
    dynamicArrayStack stack;
    dynamicArrayStackInit(&stack);
    int buffer[BUFFER_SIZE] = {4, 32, 21, 56, 87};
    for (int idx = 1; idx <= BUFFER_SIZE; idx++)
    {
        dynamicArrayStackPush(&stack, &buffer[idx]);
    }
    int size = 0;
    int *val = NULL;
    dynamicArrayStackGetSize(&stack, &size);
    printf("size=%d\n", size);

    while (!whetherDynamicStackIsEmpty(&stack))
    {
        dynamicArrayStackTop(&stack, (void **)&val);
        printf("val=%d\n", *val);
        dynamicArrayStackPop(&stack);
    }

    /*栈的销毁*/
    dynamicArrayStackDestroy(&stack);

    return 0;
}